<?php
/**
 * SiteStatus.class.php
 *
 * @author camfee <camfee@foxmail.com>
 * @date   18-1-15 下午1:17
 */

namespace Admin;

use Common\ModuleBase;
use Common\Bridge;

class SiteStatus extends ModuleBase
{
    protected static $_conf = [
        'db' => [
            'w' => Bridge::DB_ADMIN_W,
            'r' => Bridge::DB_ADMIN_R
        ],
        'table' => 'SiteStatus',
        'fields' => [
            'Id' => self::VAR_TYPE_KEY,
            'Type' => self::VAR_TYPE_STRING,
            'Num' => self::VAR_TYPE_INT,
            'CreateDate' => self::VAR_TYPE_STRING,
        ],
        'mc' => Bridge::MEMCACHE_DEFAULT,
        // 可选, MC KEY, "KeyName:%d", %d会用主键ID替代
        'mckey' => 'SiteStatus:%d',
        // 可选, 超时时间, 默认不过期
        'mctime' => 86400,
    ];

    const TYPE_COIN_DONATE = 103;

    /**
     * 获取预支金果等统计
     *
     * @param     $type
     * @param int $offset
     * @param int $limint
     * @return array
     */
    public static function getStatisticList($type, $offset = 0, $limint = 20)
    {
        $where = [
            'Type' => $type
        ];

        return self::getList($where, $offset, $limint);
    }

    /**
     * @see ModuleBase::add() 新增
     * @see ModuleBase::update() 更新
     * @see ModuleBase::getInfoByIds() 按id查询
     * @see ModuleBase::getList() 条件查询
     * @see ModuleBase::delete() 删除
     */

}